import BasicLayout from '@/layouts/basic-layout';

import showPageList from '@/configFile/product/baseList/index';
import editPageList from '@/configFile/product/baseEdit/index';
import addPageList from '@/configFile/product/baseAdd/index';
import viewPageList from '@/configFile/product/baseView/index';
import util from '@/libs/util';
let dynamicRouter = util.Pub.dynamicRouter(showPageList);
let editPageRouters = util.Pub.dynamicRouter(editPageList, 'edit');
let addPageRouters = util.Pub.dynamicRouter(addPageList, 'add');
let viewPageRouters = util.Pub.dynamicRouter(viewPageList, 'view');

const meta = {
    auth: true
};

// const pre = 'example';

export default {
    path: '/basePage',
    name: 'basePage',
    redirect: {
        name: 'basePage'
    },
    meta,
    component: BasicLayout,
    children: [
        ...dynamicRouter, // 动态插入列表页面路由
        ...editPageRouters, // 动态插入编辑页面的路由
        ...addPageRouters, // 动态插入新增页面的路由
        ...viewPageRouters // 动态插入新增页面的路由
    ]
};
